import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "home" */ '@/views/home'),
    children: [{
      path: '/home/index',
      name: 'index',
      component: () => import(/* webpackChunkName: "index" */ '@/views/home/index/index.vue')
    },{
      path: '/home/list',
      name: 'list',
      component: () => import(/* webpackChunkName: "list" */ '@/views/home/list')
    },{
      path: '/home/add',
      name: 'add',
      component: () => import(/* webpackChunkName: "add" */ '@/views/home/add')
    }]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '@/views/login')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
